package day0218;

import java.util.Scanner;

public class Test6 {
    //main方法：让文件能运行
    public static void main(String[] args) {
        //注册的信息
        String username = "zhangSan";
       // String password = "1234567";
        int count = 0;
        Scanner sc=new Scanner(System.in);
        while (count<5) {
            //用户输入的信息
            System.out.println("请输入用户名");
            String inputAcc = sc.nextLine();
            System.out.println("请输入密码");
            String inputPwd = sc.nextLine();
            //          相等
            if (username.equals(inputAcc)) {
                System.out.println("登录成功");
                return;
            } else {
                System.out.println("登录失败");
                count++;
            }
        }


    }
}
